import { DataType } from './interface'
import type { PayloadAction } from '@reduxjs/toolkit'
// 设置用户信息
export const setUserInfo = (state: DataType, action: PayloadAction<any>) => {
  state.user_info = action.payload
}
// 设置学生管理编辑框的显示
export const setIsShowStudentEdit = (state: DataType, action: PayloadAction<any>) => {
  state.is_show_student_edit = action.payload
}
// 设置学生管理中点击编辑该学生的信息
export const setStudentInfo = (state: DataType, action: PayloadAction<any>) => {
  state.student_info = action.payload
}
// 设置学生管理列表中的数据
export const setStudentListData = (state: DataType, action: PayloadAction<any>) => {
  state.student_list_data = {
    ...state.student_list_data,
    ...action.payload
  }
}
// 设置管理员列表中的数据
export const setAdminListData = (state: DataType, action: PayloadAction<any>) => {
  state.admin_list_data = {
    ...state.admin_list_data,
    ...action.payload
  }
}
